package com.itheima.mapper;

import com.itheima.pojo.Role;
import com.itheima.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @className UserMapper
 */
@Mapper
public interface UserMapper {

    @Select("select * from t_user where username=#{username}")
    User selectUserByUsername(String username); //根据用户名查询数据库中用户信息

    List<Role> selectRolesByUserId(Integer id); //根据用户id查询用户所拥有的角色
}
